
package com.sskj.jkzx.service.impl;

import javax.transaction.Transactional;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sskj.jkzx.domain.entity.quantity.EmpCreditQuantity;
import com.sskj.jkzx.domain.entity.quantity.EmpQuantity;
import com.sskj.jkzx.domain.entity.quantity.EmpTypeQuantity;
import com.sskj.jkzx.domain.entity.quantity.EngQuantity;
import com.sskj.jkzx.domain.entity.quantity.HtEngQuantity;
import com.sskj.jkzx.domain.entity.quantity.HtQuantity;
import com.sskj.jkzx.domain.entity.quantity.OrgCreditQuantity;
import com.sskj.jkzx.domain.entity.quantity.OrgQuantity;
import com.sskj.jkzx.domain.entity.quantity.OrgTypeQuantity;
import com.sskj.jkzx.domain.entity.quantity.SgxkEngQuantity;
import com.sskj.jkzx.domain.entity.quantity.SgxkQuantity;
import com.sskj.jkzx.domain.entity.quantity.TsEngQuantity;
import com.sskj.jkzx.domain.entity.quantity.TsQuantity;
import com.sskj.jkzx.domain.entity.quantity.WgclQuantity;
import com.sskj.jkzx.domain.entity.quantity.WgclTypeQuantity;
import com.sskj.jkzx.domain.entity.quantity.ZtbEngQuantity;
import com.sskj.jkzx.domain.entity.quantity.ZtbQuantity;
import com.sskj.jkzx.repository.EmpCreditQuantityRepository;
import com.sskj.jkzx.repository.EmpQuantityRepository;
import com.sskj.jkzx.repository.EmpTypeQuantityRepository;
import com.sskj.jkzx.repository.EngQuantityRepository;
import com.sskj.jkzx.repository.HtEngQuantityRepository;
import com.sskj.jkzx.repository.HtQuantityRepository;
import com.sskj.jkzx.repository.OrgCreditQuantityRepository;
import com.sskj.jkzx.repository.OrgQuantityRepository;
import com.sskj.jkzx.repository.OrgTypeQuantityRepository;
import com.sskj.jkzx.repository.SgxkEngQuantityRepository;
import com.sskj.jkzx.repository.SgxkQuantityRepository;
import com.sskj.jkzx.repository.TsEngQuantityRepository;
import com.sskj.jkzx.repository.TsQuantityRepository;
import com.sskj.jkzx.repository.WgclQuantityRepository;
import com.sskj.jkzx.repository.WgclTypeQuantityRepository;
import com.sskj.jkzx.repository.ZtbEngQuantityRepository;
import com.sskj.jkzx.repository.ZtbQuantityRepository;

@Service
public class QuantityServiceImpl {

	protected final Log logger = LogFactory.getLog(QuantityServiceImpl.class);

	@Autowired
	TsQuantityRepository tsQuantityRepository;

	@Autowired
	HtQuantityRepository htQuantityRepository;

	@Autowired
	SgxkQuantityRepository sgxkQuantityRepository;

	@Autowired
	SgxkEngQuantityRepository sgxkEngQuantityRepository;

	@Autowired
	ZtbQuantityRepository ztbQuantityRepository;

	@Autowired
	WgclQuantityRepository wgclQuantityRepository;

	@Autowired
	OrgQuantityRepository orgQuantityRepository;

	@Autowired
	EmpQuantityRepository empQuantityRepository;

	@Autowired
	EmpTypeQuantityRepository empTypeQuantityRepository;

	@Autowired
	EmpCreditQuantityRepository empCreditQuantityRepository;

	@Autowired
	OrgCreditQuantityRepository orgCreditQuantityRepository;

	@Autowired
	TsEngQuantityRepository tsEngQuantityRepository;

	@Autowired
	ZtbEngQuantityRepository ztbEngQuantityRepository;

	@Autowired
	OrgTypeQuantityRepository orgTypeQuantityRepository;

	@Autowired
	EngQuantityRepository engQuantityRepository;

	@Autowired
	HtEngQuantityRepository htEngQuantityRepository;

	@Autowired
	WgclTypeQuantityRepository wgclTypeQuantityRepository;

	@Transactional
	public void saveSgxkEng(SgxkEngQuantity entity) {

		sgxkEngQuantityRepository.save(entity);
	}

	public SgxkEngQuantity sgxkzjengqt() {

		SgxkEngQuantity result = sgxkEngQuantityRepository.findZjLastOne();
		return result;
	}

	public SgxkEngQuantity sgxkjgengqt() {

		SgxkEngQuantity result = sgxkEngQuantityRepository.findJgLastOne();
		return result;
	}

	@Transactional
	public void saveWgcltype(WgclTypeQuantity entity) {

		wgclTypeQuantityRepository.save(entity);
	}

	public WgclTypeQuantity wgclzjtypeeqt() {

		WgclTypeQuantity result = wgclTypeQuantityRepository.findZjLastOne();
		return result;
	}

	public WgclTypeQuantity wgcljgtypeeqt() {

		WgclTypeQuantity result = wgclTypeQuantityRepository.findJgLastOne();
		return result;
	}

	@Transactional
	public void saveHtEng(HtEngQuantity entity) {

		htEngQuantityRepository.save(entity);
	}

	public HtEngQuantity htengqt() {

		HtEngQuantity result = htEngQuantityRepository.findLastOne();
		return result;
	}

	@Transactional
	public void saveEng(EngQuantity entity) {

		engQuantityRepository.save(entity);
	}

	public EngQuantity engqt() {

		EngQuantity result = engQuantityRepository.findLastOne();
		return result;
	}

	@Transactional
	public void saveOrgtype(OrgTypeQuantity entity) {

		orgTypeQuantityRepository.save(entity);
	}

	public OrgTypeQuantity orgtypeqt() {

		OrgTypeQuantity result = orgTypeQuantityRepository.findLastOne();
		return result;
	}

	public OrgTypeQuantity orgtypeqtByType(String type) {

		OrgTypeQuantity result = orgTypeQuantityRepository.findLastOneByType(type);
		return result;
	}

	@Transactional
	public void saveZtbeng(ZtbEngQuantity entity) {

		ztbEngQuantityRepository.save(entity);
	}

	public ZtbEngQuantity ztbzjengqt() {

		ZtbEngQuantity result = ztbEngQuantityRepository.findZjLastOne();
		return result;
	}

	public ZtbEngQuantity ztbjgengqt() {

		ZtbEngQuantity result = ztbEngQuantityRepository.findJgLastOne();
		return result;
	}

	@Transactional
	public void saveTseng(TsEngQuantity entity) {

		tsEngQuantityRepository.save(entity);
	}

	public TsEngQuantity tsengqt() {

		TsEngQuantity result = tsEngQuantityRepository.findLastOne();
		return result;
	}

	@Transactional
	public void saveOrgc(OrgCreditQuantity entity) {

		orgCreditQuantityRepository.save(entity);
	}

	public OrgCreditQuantity orgcqt() {

		OrgCreditQuantity result = orgCreditQuantityRepository.findLastOne();
		return result;
	}

	@Transactional
	public void saveEmpc(EmpCreditQuantity entity) {

		empCreditQuantityRepository.save(entity);
	}

	public EmpCreditQuantity empcqt() {

		EmpCreditQuantity result = empCreditQuantityRepository.findLastOne();
		return result;
	}

	@Transactional
	public void saveEmptype(EmpTypeQuantity entity) {

		empTypeQuantityRepository.save(entity);
	}

	public EmpTypeQuantity emptypeqt() {

		EmpTypeQuantity result = empTypeQuantityRepository.findLastOne();
		return result;
	}

	@Transactional
	public void saveEmp(EmpQuantity entity) {

		empQuantityRepository.save(entity);
	}

	public EmpQuantity empqt() {

		EmpQuantity result = empQuantityRepository.findLastOne();
		return result;
	}

	@Transactional
	public void saveOrg(OrgQuantity entity) {

		orgQuantityRepository.save(entity);
	}

	public OrgQuantity orgqt() {

		OrgQuantity result = orgQuantityRepository.findLastOne();
		return result;
	}

	@Transactional
	public void saveTs(TsQuantity entity) {

		tsQuantityRepository.save(entity);
	}

	@Transactional
	public void saveHt(HtQuantity entity) {

		htQuantityRepository.save(entity);
	}

	@Transactional
	public void saveSgxk(SgxkQuantity entity) {

		sgxkQuantityRepository.save(entity);
	}

	@Transactional
	public void saveZtb(ZtbQuantity entity) {

		ztbQuantityRepository.save(entity);
	}

	@Transactional
	public void saveWgcl(WgclQuantity entity) {

		wgclQuantityRepository.save(entity);
	}

	public TsQuantity tseqt() {

		return tsQuantityRepository.findLastOne();

	}

	public HtQuantity hteqt() {

		return htQuantityRepository.findLastOne();

	}

	public SgxkQuantity sgxkeqt() {

		return sgxkQuantityRepository.findLastOne();

	}

	public WgclQuantity wgcleqt() {

		return wgclQuantityRepository.findLastOne();

	}

	public ZtbQuantity ztbeqt() {

		return ztbQuantityRepository.findLastOne();

	}
}
